package com.appkubes.fintech.admin.application.risk.data.fund.controller;

import com.appkubes.fintech.admin.application.risk.data.fund.entity.dto.RiskPortraitDTO;
import com.appkubes.fintech.admin.application.risk.data.fund.entity.dto.SocreDTO;
import com.appkubes.fintech.admin.application.risk.data.fund.entity.vo.RiskPortraitVO;
import com.appkubes.fintech.admin.application.risk.data.fund.service.RiskPortraitService;
import com.appkubes.fintech.admin.application.risk.data.fund.service.ScoreService;
import com.appkubes.fintech.common.response.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "51公积金")
@RestController
@RequestMapping("risk/fund")
public class FundController {
    @Resource
    private ScoreService scoreService;

    @Resource
    private RiskPortraitService RrskPortraitService;

    @ApiOperation("获取龙井分")
    @PostMapping("/getScore")
    public Response getScore(@RequestBody RiskPortraitVO request ) {
        SocreDTO score= scoreService.getScore(request.getUserKey());
        return Response.success(score);
    }


    @ApiOperation("获取风险画像")
    @PostMapping("/getRiskPortrait")
    public Response getRiskPortrait(@RequestBody RiskPortraitVO request ) {
        RiskPortraitDTO score= RrskPortraitService.getRiskPortrait(request.getUserKey());
        return Response.success(score);
    }
}
